﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using UtilZ.Dotnet.Ex.Model;

namespace ConAppCore.Test
{
    internal class TestDisposablerItem
    {
        unsafe public static void Test()
        {
            //int disposeOrder = 0;

            //int[] arr = new int[10];
            //GCHandle handle = GCHandle.Alloc(arr, GCHandleType.Pinned);
            //using var item1 = new DisposablerItem(ref handle, disposeOrder++);
            //using var item2 = new DisposablerItem(new MemoryStream(), disposeOrder++);
            //using var item3 = new DisposablerItem(NativeMemory.Alloc(10), disposeOrder++);
            //using var item4 = new DisposablerItem(Marshal.AllocHGlobal(10), disposeOrder++);
            //using var item5 = new DisposablerItem(Marshal.AllocHGlobal(sizeof(GCHandle)), typeof(GCHandle), disposeOrder++);
        }
    }
}
